package cn.col.gszf.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import java.time.LocalDateTime;
import java.util.List;


/**
* @Description 频道实体
* @Author: wanghong
* @Date: 2024/6/17
*/
@Data
@TableName(value = "channel")
public class Channel{

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    /*
     * 频道名称
     * */
    @TableField("title")
    private String title;

    /*
     * 频道简介
     * */
    @TableField("info")
    private String info;

    /*
     * 总投票人数
     * */
    @TableField("voting_num")
    private Integer votingNum;

    /**
     * 频道下投票实体
     * 查询时忽略此字段
     */
    @TableField(exist = false)
    private List<Vote> votes;

    @CreatedDate
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    @TableField("end_time")
    @LastModifiedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;


    @TableField("create_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createAt;


    @TableField("update_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateAt;
}
